﻿namespace DesignModeConsole.结构型.适配器模式;

/// <summary>
/// 适配器模式
/// </summary>
public class AdapterService : IService
{
    public void Main()
    {
        #region 日志记录示例

        //类对象模式
        ILogTargetOld log = new DatabaseLogAdapter();
        log.Write();

        ILogTargetOld log2 = new FileLogAdapter();
        log2.Write();

        //对象适配器
        ILogTargetOld log3 = new LogAdapter2(new DatabaseLog());
        log3.Write();

        #endregion 日志记录示例
    }
}